package com.ja.openchat.ui.me;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.Nullable;

import com.ja.openchat.BR;
import com.ja.openchat.R;
import com.ja.openchat.databinding.FragmentRechargeSuccessBinding;
import com.ja.openchat.viewmodels.RechargeSuccessViewModel;
import com.ja.openchat.viewmodels.WithdrawalViewModel;

import me.goldze.mvvmhabit.base.BaseFragment;

//充值或提现成功
public class RechargeSuccessFragment extends BaseFragment<FragmentRechargeSuccessBinding, RechargeSuccessViewModel> {

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_recharge_success;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        super.initData();
        Bundle arguments = getArguments();
        if (arguments != null) {
            viewModel.money.set("¥" + arguments.getString("money", "0"));
            if (WithdrawalViewModel.FROM_TYPE.equals(arguments.getString("fromType"))) {
                viewModel.rechargeStatus.set("提现成功");
                viewModel.rechargeBalance.set("我们将尽快为您处理");
            }
        }
    }
}